<template>
  <el-card>
    <div slot="header">
      <h3>商品负责人-查看</h3>
    </div>
    <div class="view-list-wrap">
      <SkusTable
        :tableHeight="480"
        :defaultMinWidth="100"
        :dataSource="tableInfo.list"
        :columns="tableInfo.columns"
        :loading="tableInfo.loading"
      />
    </div>
  </el-card>
</template>
<script>
import SkusTable from '@/components/skusTable';
import { VIEW_PERSON_TABLE_COLUMNS } from './constants';
import { getPersonDetailService } from '@/api/commodity/departmentManage/departmentManage';
export default {
  components: {
    SkusTable
  },
  data () {
    return {
      tableInfo: {
        list: [],
        columns: [...VIEW_PERSON_TABLE_COLUMNS],
        loading: false
      },
    }
  },
  mounted () {
    this.getPersonDetails()
  },
  methods: {
    async getPersonDetails () {
      const data = { hrDepartmentId: this.$route.query?.hrDepartmentId }
      const res = await getPersonDetailService(data, '.view-list-wrap')
      if (res?.retData) {
        this.tableInfo.list = res.retData
      }
    }
  }
}
</script>
